package com.cnc.dao;

import com.cnc.pojo.Course;
import com.cnc.pojo.CourseDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CourseDetailMapper {

    @Insert("insert into coursedetail(name,type,url,start_data,cid) values(#{cd.name},#{cd.type},#{cd.url},#{cd.start_data},#{cd.cid})")
    int addCourseDetail(@Param("cd") CourseDetail cd);

    @Select("select * from coursedetail where cid=#{cid}")
    List<CourseDetail> getInfo(@Param("cid") String cid);

    @Select("select DISTINCT type from coursedetail where cid=#{cid}")
    List<String> getChapter(@Param("cid") String cid);
}
